package com.southern.gateway.feign.sysApi;

import com.southern.gateway.base.ResultModel;
import com.southern.gateway.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "sysApi", url = "${feignApi.sysApi}", configuration = FeignConfig.class)
public interface SysApiLogin {
	/**
	 * 用户登录
	 *
	 * @param username 用户名
	 * @param pwd      密码
	 * @return
	 */
	@PostMapping("/auth/login")
	public ResultModel login(@RequestParam(value = "username" , required = false) String username,
                             @RequestParam(value = "pwd") String pwd);

	/**
	 * 用户退出
	 *
	 * @return
	 */
	@RequestMapping(value = "/auth/logout", method = RequestMethod.POST)
	public ResultModel logout();

	/**
	 * 校验token的有效性
	 *
	 * @return
	 */
	@GetMapping(value = "/auth/checkTokenIsEffect")
	public ResultModel checkTokenIsEffect(@RequestParam(value = "token")  String token);

}
